<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品列表</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>

<style type="text/css">
#searchbar{
   margin-bottom: 10px;
   margin-left:15px;
  }
  .navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search {
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
</style>
</head>

<body style="padding:6px; overflow:hidden;">
<div class="navbar">
		<span>您当前的位置：</span>
		库存异动异常
</div><br>

<div id="maingrid" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- 展示列表数据  -->
</div><br><br>

	<script>
	var grid = null;
	var icsJson = ${icsJson};
	var icsSize = ${icsSize};
    var icsJsonData = {"Rows": icsJson, "Total": icsSize};
    $(function () {
    	grid = $("#maingrid").ligerGrid({
            columns: [
            { display: '仓库编码', name: 'warehouseCode',align: 'left', width: '8%' },
            { display: '单号', name: 'orderNo', width: '12%' },
            { display: '模块编码', name: 'moduleCode', width: '10%' },
            { display: '货品编码', name: 'sku', width:'10%' },
            { display: '数量', name: 'qty',align: 'left', width:'10%' },
            { display: '审核人', name: 'auditor',align: 'left', width:'10%' },
            { display: '审核时间', name: 'auditTime', width:'12%' },
            { display: '备注', name: 'remark', width:'10%' }
            ], 
            pageSize:30,
            width: '100%',
            height: '100%',
            toolbar: { items: [
          		{ text: "手动存入", click: manualAdd, icon: "add"},
          		{ line: true },
          		{ text: "返回", click: returnToParent, icon: "prev"}
            ]},
    		data: $.extend(true,{},icsJsonData)
        });
   	});
	function manualAdd() {
		if (icsSize == 0) {
			alert("无库存异动异常数据");
			return;
		}
		$.ligerDialog.confirm('确定手动存入', function(yes) {
			if (yes) {
				$.post("addInventoryChangeException.do", function(data) {
							if (data == "success") {
								alert("存入成功");
								window.location.reload();
							} else {
								alert("存入失败" + data);
								window.location.reload();
							}
						});
			}
		});
	}
	function returnToParent() {
		close_liger_tab();
	}
    </script>
	
</body>
</html>